package com.adopapa.nezhacloud.register.domain;

import java.time.Instant;
import java.util.Date;

import com.adopapa.importexcel.ExcelField;
import com.adopapa.nezhacloud.ddd.codegen.CodeGen;
import com.adopapa.nezhacloud.ddd.domain.BaseUuidEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;

@Entity
@Table(name = "STUDY_STAT")
public class StudyStat extends BaseUuidEntity {

	private static final long serialVersionUID = -8865821198311425100L;

	@ExcelField
	@CodeGen(query = "%", form = true, label = "用户ID", required = true, unique = true)
	@Column(name = "USER_ID")
	private String userId;
	@ExcelField
	@CodeGen(query = "%", form = true, label = "用户昵称", required = true)
	@Column(name = "NICK_NAME")
	private String nickName;
	@ExcelField
	@CodeGen(query = "=", form = true, label = "最近采集号码", required = true)
	@Column(name = "COLLECT_CODE")
	private String collectCode;
	@ExcelField
	@CodeGen(query = "%", form = true, label = "单品名称", required = true)
	@Column(name = "ITEM_NAME")
	private String itemName;
	@ExcelField
	@CodeGen(query = "=", form = true, label = "课程类型", required = true)
	@Column(name = "COURSE_TYPE")
	private String courseType;
	@ExcelField
	@CodeGen(form = true, label = "累计学习时长", required = true)
	@Column(name = "AMOUNT_TOSTR")
	private String amountToStr;
	@ExcelField
	@CodeGen(form = true, label = "累计学习时长(秒)", required = true)
	@Column(name = "AMOUNT_TOSEC")
	private Long amountToSec;
	@ExcelField
	@CodeGen(form = true, label = "学习进度", required = true)
	@Column(name = "PROGRESS")
	private String progress;
	@ExcelField
	@CodeGen(query = "=", form = true, label = "课程完成数", required = true)
	@Column(name = "COURSE_ENDED")
	private Integer courseEnded;
	@CodeGen(form = true, label = "首次学习时间", required = true)
	@Column(name = "START_TIME")
	private Instant startTime;
	@Transient
	@ExcelField
	private Date startDate;
	@ExcelField
	@CodeGen(form = true, label = "有效学习时长", required = true)
	@Column(name = "VALID_TIME_STR")
	private String validTimeStr;
	@ExcelField
	@CodeGen(form = true, label = "有效学习时长(秒)", required = true)
	@Column(name = "VALIDE_TIME_SEC")
	private Long validTimeSec;
	@CodeGen(form = true, label = "完成时间", required = true)
	@Column(name = "END_TIME")
	private Instant endTime;
	@Transient
	@ExcelField
	private Date endDate;
	@ExcelField
	@CodeGen(query = "=", form = true, label = "手机号码", required = true, unique = true)
	@Column(name = "CELLPHONE")
	private String cellphone;
	@ExcelField
	@CodeGen(query = "%", form = true, label = "学员姓名", required = true)
	@Column(name = "STUDENT_NAME")
	private String name;

	@CodeGen(query = ">=", time = true, label = "开始时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Column(name = "CREATE_TIME")
	private Instant createTime;
	@CodeGen(query = "=", label = "是否注册")
	@Column(name = "REGISTED")
	private Boolean registed;
	@CodeGen(query = "=", label = "学员Id")
	@Column(name = "STUDENT_ID")
	private String studentId;

	//////////////////////////////////////////////////////////////
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getCollectCode() {
		return collectCode;
	}

	public void setCollectCode(String collectCode) {
		this.collectCode = collectCode;
	}

	public String getItemName() {
		return itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}

	public String getCourseType() {
		return courseType;
	}

	public void setCourseType(String courseType) {
		this.courseType = courseType;
	}

	public String getAmountToStr() {
		return amountToStr;
	}

	public void setAmountToStr(String amountToStr) {
		this.amountToStr = amountToStr;
	}

	public Long getAmountToSec() {
		return amountToSec;
	}

	public void setAmountToSec(Long amountToSec) {
		this.amountToSec = amountToSec;
	}

	public String getProgress() {
		return progress;
	}

	public void setProgress(String progress) {
		this.progress = progress;
	}

	public Integer getCourseEnded() {
		return courseEnded;
	}

	public void setCourseEnded(Integer courseEnded) {
		this.courseEnded = courseEnded;
	}

	public Instant getStartTime() {
		return startTime;
	}

	public void setStartTime(Instant startTime) {
		this.startTime = startTime;
	}

	public String getValidTimeStr() {
		return validTimeStr;
	}

	public void setValidTimeStr(String validTimeStr) {
		this.validTimeStr = validTimeStr;
	}

	public Long getValidTimeSec() {
		return validTimeSec;
	}

	public void setValidTimeSec(Long validTimeSec) {
		this.validTimeSec = validTimeSec;
	}

	public Instant getEndTime() {
		return endTime;
	}

	public void setEndTime(Instant endTime) {
		this.endTime = endTime;
	}

	public String getCellphone() {
		return cellphone;
	}

	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Instant getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Instant createTime) {
		this.createTime = createTime;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Boolean getRegisted() {
		return registed;
	}

	public void setRegisted(Boolean registed) {
		this.registed = registed;
	}

	public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

}
